package com.ddone.bean;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * @author ddone
 * @date 2024/4/9-12:15
 */

@NoArgsConstructor
@AllArgsConstructor
@Builder
@Data
@Document(indexName = "user",shards = 1,replicas = 1)
@JsonIgnoreProperties(ignoreUnknown = true)
public class User {

    @Id
    private Long id;

    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String name;

    @Field(type = FieldType.Integer)
    private Integer age;

    @Field(type = FieldType.Keyword, index = false)
    private String pwd;
}
